import { ExecutionContext } from '@nestjs/common';
import { createParamDecorator, SetMetadata } from '@nestjs/common';
import type { Request } from 'express'
// 自定义装饰器--用于注册元信息
export const Role = (...args: string[]) => SetMetadata('roles', args);
// 自定义装饰器--用于获取请求url
export const ReqUrl = createParamDecorator((data: string, ctx: ExecutionContext) => {
    const req = ctx.switchToHttp().getRequest<Request>();
    return req.url;
})